package demo1;

public class Test {
    public static void main(String[] args)
            throws CloneNotSupportedException{
        Person person1 = new Person("zhangsan");

        //返回值是object对象
        //解决当前类是否可以被克隆
        Person person2 = (Person)person1.clone();

        System.out.println(person1.money.money);
        System.out.println(person2.money.money);

        System.out.println(person2);
        System.out.println("======================");

        person2.money.money=19.9;
        System.out.println(person1.money.money);
        System.out.println(person2.money.money);
    }
}
